<div class="docs">
<table cellspacing="3" border="true">
    <thead>
      <tr>
        <th>
          Document Name
        </th>
        <th>
          Category
        </th>
        <th>
          Description
        </th>
        <th>
          Author
        </th>
        <th>
          Author e-mail
        </th>
        <th>
          Last changes were done at
        </th>    
        <?php if(isset($no_write_versions) && !$no_write_versions):?>
          <th>
            Version
          </th>
        <?php endif;?>
      </tr>
    </thead>
    <tbody>
      <?php if (!empty($documents)): ?>
        <?php foreach ($documents as $document):?>
          <tr>
            <td class="name">
              <?php echo $document->getName(); ?>
            </td>
            <td class="category">
              <?php echo $document->getCategory(); ?>
            </td>
            <td class="description">
              <?php echo $document->getDescription(); ?>
            </td>
            <td class="modifier">
              <?php echo $document->getModifierFullName(); ?>
            </td>
            <td class="modifier">
              <?php echo $document->getAuthor(); ?>
            </td>
            <td class="updated_at">
              <?php echo $document->getUpdated_at(); ?>
            </td>   
            <?php if(isset($no_write_versions) && !$no_write_versions):?>
              <td class="version">
                <?php echo $document->getVersion(); ?>
              </td>        
            <?php endif;?>
                <?php if(!isset($no_write_view) || !$no_write_view):?>
                 
                  <td class="doc_menu">
                   <a href="<?php echo url_for('doc_info', $document) ?>"><img src="/images/viewb.png"/></a>
                  </td>
                 
                <?php else:?>
                <?php endif;?>

            <?php if(isset($no_write_versions) && !$no_write_versions && $show):?>
              <td class="doc_menu">
               <a href="<?php echo url_for('doc_vers_files', $document) ?>"><img src="/images/fileb.png"/></a>
              </td>
            <?php endif;?>
          </tr>
        <?php endforeach; ?>
      <?php endif;?>
    </tbody>
  </table>
</div>